package com.ysd.modules.app.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ysd.modules.app.entity.TestPaper;
import com.ysd.modules.app.entity.TopicEntity;

import java.util.List;
import java.util.Map;

/**
 * @Author ky
 * @Date 2021/07/19
 * 试卷
 */
public interface TestPapersService extends IService<TestPaper> {
    /**
     * 根据 课程和章节查找试卷信息
     *
     * @param courseId
     * @param chapterId
     * @return
     */
    List<TestPaper> getTestPapers(Integer courseId, Integer chapterId, Integer testMode);

    /**
     * 根据试卷id查询试卷题目
     *
     * @param pid
     * @return
     */
    List<TopicEntity> getTopicsByPid(Integer pid);

    /**
     * 生成试卷
     *
     * @param testPaper
     * @return
     */
    TestPaper insert(TestPaper testPaper);

    /**
     * 试卷详情
     *
     * @return
     */
    Map<String, Object> getPaperDetails(Integer pid);

    /**
     * 组卷
     *
     * @param title
     * @param courseId
     * @param topicNum
     * @param stuId
     * @param testMode
     * @return
     */
    TestPaper addPaper(String title, Integer courseId, Integer topicNum, Integer stuId, Integer testMode);

    /**
     * 获取paper下边的所有试题
     * @param paperId
     * @return
     */
    List<TopicEntity> getTopicsListByPaper(Integer paperId);
}
